#include"func.h"
#include"pathStack.h"
#include"transMsg.h"
#ifndef __handleCommand__
typedef struct Command_s{
    char* commandArr[1024];
    int commandNum;
}Command_t;

int commandInit(Command_t *pCommand);
int recvCommand(int netfd,char* command);

int getRealPath(pathStack_t* pPathStack,const char* subPath,char* realPath);

int serverExecCommand(int netfd,pathStack_t* pPathStack,const char* command,const char* username);
int serverExecCd(int netfd,pathStack_t* pPathStack,const char* dirName,const char* username);
int serverExecLs(int netfd,pathStack_t* pPathStack,char* dirName,const char* username);
int serverExecPwd(int netfd,pathStack_t* pPathStack,const char* username);
int serverExecPuts(int netfd,pathStack_t* pPathStack,const char* filename,const char* username);
int serverExecGets(int netfd,pathStack_t* pPathStack,const char* filename,const char* username);
int serverExecRm(int netfd,pathStack_t* pPathStack,const char* filename,const char* username);
int serverExecMkdir(int netfd,pathStack_t* pPathStack,const char* dirpath,const char* username);
int serverPutsBigFile(int sockfd,pathStack_t * pPathStack,const char* filename,const char* username);
int serverGetsBigFile(int sockfd,pathStack_t* pPathStack,const char* filename,const char* username);


int serverExecRmdir(int netfd,pathStack_t* pPathStack,const char* dirpath,const char* username);
//dirpath中不能包含.和..

int verdictTargetFile(pathStack_t* pPathStack,const char* pathname,int flag,const char* username);
//判断目录或者文件所属的目录是否存在;存在返回0，不存在返回-1;flag:0表示目录，1表示文件；

int deleteDir(const char* path); // 递归的删除文件夹


#endif
